| Miles Sound System SDK 7.2a |
Q: | I used an older version of Miles and now my volume and pan calls are weird - what's going on? And what's with the two types of volume functions? |
A: | Miles 6.5 introduced new floating point volume functions. These functions give you much finer control than the old MIDI compatible (0 to 127) range functions. You should search your application for all calls to the old Miles digital volume functions (AIL_set_sample_volume and AIL_set_stream_volume) and update them to use the new 0 to 1.0 floating point scale instead of the old 0 to 127 integer scale. And, since we were breaking the API somewhat for this new functionality, we added some extra features as well. We now give you two ways to control volume - one based on the human perception loudness scale, and one based on a linear reduction of the sound's amplitude. If you use AIL_set_sample_volume_pan to set the volume, then a 0.5 value means that the audio will "sound" half as loud to you (this means the sound is 10 dB down). If, on the other hand, you use the AIL_set_sample_volume_levels function, then a 0.5 value means that the audio's actual numeric sample values will be cut in half (this means the sound is only 6 dB down). Also note that AIL_set_sample_volume_pan now uses a power-pan calculation for the left to right setting. Power-pan means that we vary both the left-to-right mix and the absolute volume to make the total power coming out of your speakers relatively constant. So, now when you pan a sound from left to right, it won't sound louder when the audio is directly in the center. Conversely, the AIL_set_sample_volume_levels function allows you to specify the left and right volumes directly, so you can implement any type of pan that you like. For mono samples that will undergo 3D positioning, you should use a pan value of 0.5. Any other pan value will cause the 3D positioner to favor one speaker or the other in each successive multichannel pair. Note that in MSS 7, several volume-control calls that were just 'wrappers' on HSAMPLES internal to streams and DLS sequences were removed. You can use the HSAMPLE-based volume calls for these data types in conjunction with AIL_stream_sample_handle and AIL_DLS_sample_handle. As an aside, internally, the AIL_set_sample_volume_pan function just does some calculations and then calls the AIL_set_sample_volume_levels function. |
Next Topic (What kind of audio decompression does Miles support?)
Previous Topic (How do I loop a track off a CD?)
Group:
FAQs and How Tos
Related Functions:
AIL_DLS_sample_handle, AIL_sample_volume_levels, AIL_sample_volume_pan, AIL_set_sample_volume_levels, AIL_set_sample_volume_pan, AIL_stream_sample_handle
For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.